I finally found a solution by exploring this example app: https://iosexample.com/a-demo-app-exploring-the-new-app-intents-framework-in-ios16/.
Here is my new (working) implementation of ActivityEntity:
struct ActivityEntity: AppEntity {
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Activity")
typealias DefaultQuery = MobilityActivityQuery
static var defaultQuery: MobilityActivityQuery = MobilityActivityQuery()
var id: String
var name: String
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(title: "\(self.name)")
}
}
Topic:
App & System Services
SubTopic:
General
Tags: